#include <REGX52.H>
#include "Timer.h"
#include "DS1302.h"
#include "LCD1602.h"

void main()
{
	Timer0_Init();
	LCD1602_Init();
	DS1302_Init();
	DS1302_SetTime();
	LCD1602_PrintString(1,1,"      :  :");
	LCD1602_PrintString(2, 1, "  -  -");
	LCD1602_PrintString(1, 1, "RTC:");
	while(1){
		DS1302_ReadTime();
		LCD1602_PrintNum(1,5,Time[2],2);
		LCD1602_PrintNum(1,8,Time[1],2);
		LCD1602_PrintNum(1,11,Time[0],2);
		LCD1602_PrintNum(2, 1, Time[6], 2);
		LCD1602_PrintNum(2, 4, Time[4], 2);
		LCD1602_PrintNum(2, 7, Time[3], 2);
		LCD1602_PrintNum(2,12,Time[5],1);
	}
}